﻿using AssetManageSystem.Model.Enum;
using AssetManageSystem.Model.OrgManage;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;
using WalkingTec.Mvvm.Core;

namespace AssetManageSystem.Model.AssetManage
{
    /// <summary>
    /// 资产登记
    /// </summary>
    public class AssetInfo : PersistPoco
    {
        /// <summary>
        /// 资产名称
        /// </summary>
        [Display(Name = "资产名称")]
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string AsName { get; set; }

        /// <summary>
        /// 资产编码
        /// </summary>
        [Display(Name = "资产编码")]
        [StringLength(50, ErrorMessage = "{0}stringmax{1}")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string AsCode { get; set; }

        /// <summary>
        /// 资产类型
        /// </summary>
        [Display(Name = "资产类型")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public Guid? TypeId { get; set; }
        [Display(Name = "资产类型")]
        public AssetType Type { get; set; }

        /// <summary>
        /// 采购价格
        /// </summary>
        [Display(Name = "采购价格")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [Column(TypeName = "decimal(10,2)")]
        public decimal PurchasPrice { get; set; }

        /// <summary>
        /// 购入时间
        /// </summary>
        [Display(Name = "购入时间")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public DateTime? BuyTime { get; set; }

        /// <summary>
        /// 使用人
        /// </summary>
        [Display(Name = "使用人")]
        public Guid? UsePeopleId { get; set; }
        [Display(Name = "使用人")]
        public User UsePeople { get; set; }

        /// <summary>
        /// 使用部门
        /// </summary>
        [Display(Name = "使用部门")]
        public Guid? UseDepId { get; set; }
        [Display(Name = "使用部门")]
        public Department UseDep { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        [Display(Name = "规格型号")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [StringLength(50, ErrorMessage = "{0}stringmax{1}")]
        public string AssetModels { get; set; }

        /// <summary>
        /// 计量单位
        /// </summary>
        [Display(Name = "计量单位")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public MeasUnitEnum MeasUnit { get; set; }

        /// <summary>
        /// 资产权属
        /// </summary>
        [Display(Name = "资产权属")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string AssetOwnership { get; set; }
        
        /// <summary>
        /// 供应商
        /// </summary>
        [Display(Name = "供应商")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string Supplier { get; set; }

        /// <summary>
        /// 供应商联系人
        /// </summary>
        [Display(Name = "供应商联系人")]
        [StringLength(20, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string SupplierContact { get; set; }

        /// <summary>
        /// 供应商联系方式
        /// </summary>
        [Display(Name = "供应商联系方式")]
        [StringLength(20, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string SupplierTel { get; set; }

        /// <summary>
        /// 维保到期日
        /// </summary>
        [Display(Name = "维保到期日")]
        public DateTime? MaintenanceEndTime { get; set; }

        /// <summary>
        /// 产品序列号
        /// </summary>
        [Display(Name = "产品序列号")]
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string ProductSerialNumber { get; set; }

        /// <summary>
        /// 资产状态
        /// </summary>
        [Display(Name = "资产状态")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public AsStatusEnum Status { get; set; }

        /// <summary>
        /// 使用期限
        /// </summary>
        [Display(Name = "使用期限")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public int? Servicelife { get; set; }

        /// <summary>
        /// 来源
        /// </summary>
        [Display(Name = "来源")]
        [Required(ErrorMessage = "{0}是必填项")]
        public SourceEnum Source { get; set; }

        /// <summary>
        /// 详细信息
        /// </summary>
        [Display(Name = "详细信息")]
        public string Remarks { get; set; }
    }

}
